{% extends 'learning_logs/base.html' %}
{% block header %}
    <h2>
        {% for prod in product %}
            {{ prod.name }}
        {% endfor %}
    </h2>
{% endblock header %}

{% block content %}

    <p>
        <a href="{% url 'ETP:products' %}">返回<<</a>
        &nbsp;&nbsp;&nbsp;
        {% for prod in product %}
            <a href="{% url 'ETP:new_job' prod.id %}">新增job</a>
        {% endfor %}

    </p>

    <table class="table table-bordered">

        <thead class="">
            <tr>
                <th>Job名称</th>
                <th>简介</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th>上次运行时间</th>
                <th>上次运行结果</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for job in jobs %}
                <tr>
                    <td>{{ job.name }}</td>
                    <td>{{ job.description }}</td>
                    <td>{{ job.creat_time|date:'Y-n-d H:i '}}</td>
                    <td>{{ job.last_update_time|date:'Y-n-d H:i ' }}</td>
                    <td>{{ job.last_run_time|date:'Y-n-d H:i ' }}</td>
                    <td>{{ job.last_run_result }}</td>
                    <td>
                        <a href="{% url 'ETP:job' job.id %}">详情</a>
{#                        详情展示suites列表。需要传进去的参数是job.id，通过job.id来查出所有的suites。进行遍历展示#}
                        <a href="{% url 'ETP:edit_job' job.id %}">修改</a>
                        <a href="{% url 'ETP:delete_job' job.id %}">删除</a>
                        <a>一次运行</a>
                        <a>调度配置</a>
                    </td>
                </tr>
            {% endfor%}
        </tbody>
    </table>

{% endblock content %}